//账号接口模块

//引入工具函数
import request from '@/utils/request'

//登录接口函数
export const checkLoginReq = data => {
  //返回axios接口调用结果
  return request({
    method: 'post',
    url: '/users/checkLogin',
    data,
  })
}

//检测重复接口函数
export const checkUserRepeatReq = data => {
  //返回axios接口调用结果
  return request({
    method: 'post',
    url: '/users/repeat',
    data,
  })
}

//添加接口函数
export const addUserReq = data => {
  //返回axios接口调用结果
  return request({
    method: 'post',
    url: '/users/add',
    data,
  })
}

//获取用户列表接口
export const getUserListReq = params => {
  return request({
    method: 'get',
    url: '/users/list',
    params,
  })
}

// 删除用户接口
export const delUserReq = params =>{
  return request({
    method: 'get',
    url: '/users/del',
    params,
  })
}

//获取个人信息
export const getUserInfoReq = params=>{
  return request({
    method:'get',
    url:'/users/info',
    params
  })
}

//批量删除
export const batchDelUserReq = data=>{
  return request({
    method:'post',
    url:'/users/batchdel',
    data
  })
}

//修改用户头像
export const updateUserAvatarReq = params =>{
  return request({
    method:'get',
    url: '/users/avataredit',
    params,
  })
}
//检查旧密码是否正确
export const usersCheckoldpwd = params=>{
  return request ({
      url:"/users/checkoldpwd",
      method:"get",
      params
  })
}
//修改新密码
export const usersEditpwd =data=>{
  return request({
      method:"post",
      url:"/users/editpwd",
      data,
  })
}